/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 teleport_spell.h

	$Header: /heroes4/teleport_spell.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( TELEPORT_SPELL_H_INCLUDED )
#define TELEPORT_SPELL_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "bitmap_cursor.h"
#include "combat_spell_single_target.h"
#include "map_point.h"
#include "owned_ptr.h"

class t_combat_path_finder;

// -----------------------------------------------------------------
// teleport spell handler
// -----------------------------------------------------------------
class t_teleport_spell : public t_combat_spell_single_target
{
public:
	t_teleport_spell( t_battlefield& battlefield, t_spell spell );

	virtual void			cast_and_mirror( t_combat_creature_ptr target, int power ); // execute and mirror
	double							ai_weight( t_combat_creature const& target ) const;
	virtual t_combat_ai_action_list generate_combat_ai_action_list(t_combat_ai &owner);
	virtual double					get_cancel_weight( t_combat_creature const& target ) const;
	virtual t_mouse_window* mouse_move( t_screen_point const& point,
									    std::string& help_text );
	virtual bool            left_click( t_screen_point const& point );
protected:
	void move_creature();

	t_map_point_2d						m_destination;
	bool								m_selecting_source;
	t_owned_ptr<t_combat_path_finder>	m_path_finder;
	t_bitmap_cursor						m_teleport_cursor;
};

#endif // TELEPORT_SPELL_H_INCLUDED